<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<style>
*{ margin:0; padding:0;font-family:"微软雅黑";}

.notice_center{ width:100%; background-color:#f3ffeb; height:35px; border:1px #c7ddb9 solid; line-height:30px; margin-bottom:20px; text-indent:12px; color:#009900;}

.body_width{ width:100%; margin:0 auto; margin-top:40px;}

.black2{padding:7px;margin:10px;text-align:center; font-size:12px }

.black2 a{border:#CDCDCD 1px solid;padding:7px 10px;margin:5px;color:#7F7F7F;text-decoration:none;}


.black2 a:hover{border:#009ee7 1px solid;color:#fff;background-color:#009ee7;}

.black2 a:active{border:#009ee7 1px solid;color:#fff;}

.black2 span.current{border:#009ee7 1px solid;padding:7px 10px;font-weight:bold;margin:5px;color:#fff;background-color:#009ee7;}

.black2 span.disabled{border:#eee 1px solid;padding:7px 10px;margin:5px;color:#ddd;}

.table-hover tr th{border:2px solid #286090!important;background:#286090;color:#fff;font-size:15px;}

.btn-warning{height:30px; width:120px; background-color:#61c3d0; color:#FFF; border:none;margin-left:10px;border-radius:5px;}

.search input{width:140px;height:30px;line-height:15px;border-radius:5px;border:1px solid #ccc;}

.search select{width:140px;height:30px;line-height:15px;border-radius:5px;border:1px solid #ccc;}

.body_width select、input{margin-right:10px;width:140px;height:30px;border-radius:5px;border:1px solid #ccc;}

iframe{width:100%;}
</style>
	 <div class="black2"><a href="javascript:jump(${params.pagination.currentPage -1 },${params.pagination.pageSize })" 
	 <c:if test="${params.pagination.currentPage==1 }">style="display: none;"</c:if>> 上一页 </a>
		 <c:if test="${params.pagination.pageCount>1}">
			 <c:forEach var="i" begin="1" end="${params.pagination.pageCount }" varStatus="status">
			 	<c:if test="${params.pagination.currentPage==status.index }">
			      <span class="current">${status.index}</span>
			    </c:if>
			    <c:if test="${params.pagination.currentPage!=status.index }">
			      <a id="a${status.index  }" href="javascript:jump(${status.index},${params.pagination.pageSize })">${status.index}</a>
			    </c:if>
			 </c:forEach>
		  </c:if>
		  <a href="javascript:jump(${params.pagination.currentPage +1},${params.pagination.pageSize })" <c:if test="${params.pagination.currentPage == params.pagination.pageCount }">style="display: none;"</c:if>> 下一页 </a>
	  </div>
	  <script type="text/javascript">
	  	var currentPage = "${params.pagination.currentPage}";
	  	var pageCount = "${params.pagination.pageCount }";
	  	var a = document.getElementsByTagName("a");
	  	if(pageCount>11){
		  	if(currentPage>6&&currentPage<pageCount-5){
		        for (i = 0; i < a.length; i++) {
		        	var aId = Number(a[i].id.substring(1));
		           	if(aId<currentPage-3&&aId>1){
		           		a[i].style.display="none";
		           	}
		           	if(aId<pageCount&&aId>Number(currentPage)+3){
		           		a[i].style.display="none";
		           	}
		       	}
		       	$("#a1").after("•••"); 
		       	$("#a"+pageCount).before("•••"); 
		  	}else if(currentPage<=6){
		  		for (i = 0; i < a.length; i++) {
		  			var aId = Number(a[i].id.substring(1));
		           	if(aId<pageCount&&aId>=10){
		           		a[i].style.display="none";
		           	}
		       	}
		       	$("#a"+pageCount).before("•••");  
		  	}else if(currentPage>=pageCount-5){
		  		for (i = 0; i < a.length; i++) {
		  			var aId = Number(a[i].id.substring(1));
		           	if(aId<=pageCount-9&&aId>1){
		           		a[i].style.display="none";
		           	}
		       	}
		       	$("#a1").after("•••"); 
		  	}
	  	}
	  	
	  	function jump(p,s) {
	  	/* var pageSize = "<input type='hidden' name='pageSize' value='"+s+"'>"
	  	var currentPage = "<input type='hidden' name='currentPage' value='"+p+"'>" */
	  	var olElement = document.getElementById('search');  
	  	var pageSize = document.createElement('input');  
		  	pageSize.type = "hidden";  
		  	pageSize.name = "pageSize";
		  	pageSize.value=s;
		var currentPage = document.createElement('input');  
		  	currentPage.type = "hidden";  
		  	currentPage.name = "currentPage";
		  	currentPage.value=p;
		  	olElement.appendChild(pageSize);
		  	olElement.appendChild(currentPage);
		  	olElement.submit();
		}
	  </script>
	<%-- 
	<table >
    	<tr>
    		<td style="text-align:right;">
    		${session }
    		${sessionScope.page }
    			第<span style="color:red">${page.currentPage }</span>/${page.pageCount }页
    			共${page.total}条
    		</td>
	   		<td style="text-align:right">
	   			<c:choose>
	   				<c:when test="${ page.currentPage==1}">
	    				首页
	   					上一页
	   				</c:when>
	   				<c:otherwise>
	    				<a href="javascript:jump(1,${page.pageSize })">首页</a>
	   					<a href="javascript:jump(${page.currentPage -1 },${page.pageSize })">上一页</a>
	   				</c:otherwise>		
	   			</c:choose>
	   			<c:choose>
	   				<c:when test="${ page.currentPage == page.pageCount}">
	    				下一页
	   					末页
	   				</c:when>
	   				<c:otherwise>
	    				<a href="javascript:jump(${page.currentPage +1},${page.pageSize })">下一页</a>
	    				<a href="javascript:jump(${page.pageCount},${page.pageSize })">末页</a>
	   				</c:otherwise>		
	   			</c:choose>
	   			转到<input type="text" id="gPage" Style="width:30px" onKeyUp="value=value.replace(/\D/g, '')" name="page.currentPage" /><input type="button" value="GO" onclick="jump(document.getElementById('gPage').value==''?1:document.getElementById('gPage').value<${page.pageCount}?document.getElementById('gPage').value: ${page.pageCount},${page.pageSize })" />
	   		</td>
   		</tr>
    </table> --%>